﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web.Http;
using System.Web.Http.Controllers;
using System.Net.Http;
using System.Net;
using Yuchen.Log.Utils;
namespace Xinchen.SOA.Server.ServiceHosting
{
    public class ControllerActionInvoker : ApiControllerActionInvoker
    {
        public override Task<System.Net.Http.HttpResponseMessage> InvokeActionAsync(HttpActionContext actionContext, System.Threading.CancellationToken cancellationToken)
        {
            var response = base.InvokeActionAsync(actionContext, cancellationToken);
            if (response.Exception != null)
            {
                LogWriter.GetInstance().WriteLogFile(GetType().Name, response.Exception.ToString());
            }
            return response;
        }
    }
}
